home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3c / getprotoent.z / getprotoent
Encoding:
Text File  |  2002-10-03  |  7.9 KB  |  133 lines

  1.  
  2.  
  3.  
  4. GGGGEEEETTTTPPPPRRRROOOOTTTTOOOOEEEENNNNTTTT((((3333NNNN))))                                                GGGGEEEETTTTPPPPRRRROOOOTTTTOOOOEEEENNNNTTTT((((3333NNNN))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      getprotoent, getprotobynumber, getprotobyname, getprotoent_r,
  10.      getprotobynumber_r, getprotobyname_r, fgetprotoent, fgetprotoent_r,
  11.      setprotoent, endprotoent - get protocol entry
  12.  
  13. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<nnnneeeettttddddbbbb....hhhh>>>>
  15.  
  16.      ssssttttrrrruuuucccctttt pppprrrroooottttooooeeeennnntttt ****ggggeeeettttpppprrrroooottttooooeeeennnntttt((((vvvvooooiiiidddd))));;;;
  17.  
  18.      ssssttttrrrruuuucccctttt pppprrrroooottttooooeeeennnntttt ****ggggeeeettttpppprrrroooottttooooeeeennnntttt____rrrr((((ssssttttrrrruuuucccctttt pppprrrroooottttooooeeeennnntttt ****eeeennnnttttrrrryyyy,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuufffflllleeeennnn))));;;;
  19.  
  20.      ssssttttrrrruuuucccctttt pppprrrroooottttooooeeeennnntttt ****ggggeeeettttpppprrrroooottttoooobbbbyyyynnnnaaaammmmeeee((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee))));;;;
  21.  
  22.      ssssttttrrrruuuucccctttt pppprrrroooottttooooeeeennnntttt ****ggggeeeettttpppprrrroooottttoooobbbbyyyynnnnaaaammmmeeee____rrrr((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****nnnnaaaammmmeeee,,,, ssssttttrrrruuuucccctttt pppprrrroooottttooooeeeennnntttt ****eeeennnnttttrrrryyyy,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuufffflllleeeennnn))));;;;
  23.  
  24.      ssssttttrrrruuuucccctttt pppprrrroooottttooooeeeennnntttt ****ggggeeeettttpppprrrroooottttoooobbbbyyyynnnnuuuummmmbbbbeeeerrrr((((iiiinnnntttt pppprrrroooottttoooo))));;;;
  25.  
  26.      ssssttttrrrruuuucccctttt pppprrrroooottttooooeeeennnntttt ****ggggeeeettttpppprrrroooottttoooobbbbyyyynnnnuuuummmmbbbbeeeerrrr____rrrr((((iiiinnnntttt pppprrrroooottttoooo,,,, ssssttttrrrruuuucccctttt pppprrrroooottttooooeeeennnntttt ****eeeennnnttttrrrryyyy,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuufffflllleeeennnn))));;;;
  27.  
  28.      ssssttttrrrruuuucccctttt pppprrrroooottttooooeeeennnntttt ****ffffggggeeeettttpppprrrroooottttooooeeeennnntttt((((FFFFIIIILLLLEEEE ****ffff))));;;;
  29.  
  30.      ssssttttrrrruuuucccctttt pppprrrroooottttooooeeeennnntttt ****ffffggggeeeettttpppprrrroooottttooooeeeennnntttt____rrrr((((FFFFIIIILLLLEEEE ****ffff,,,, ssssttttrrrruuuucccctttt pppprrrroooottttooooeeeennnntttt ****eeeennnnttttrrrryyyy,,,, cccchhhhaaaarrrr ****bbbbuuuuffffffffeeeerrrr,,,, iiiinnnntttt bbbbuuuufffflllleeeennnn))));;;;
  31.  
  32.      vvvvooooiiiidddd sssseeeettttpppprrrroooottttooooeeeennnntttt((((iiiinnnntttt ssssttttaaaayyyyooooppppeeeennnn))));;;;
  33.  
  34.      vvvvooooiiiidddd eeeennnnddddpppprrrroooottttooooeeeennnntttt((((vvvvooooiiiidddd))))
  35.  
  36. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  37.      _g_e_t_p_r_o_t_o_e_n_t, _g_e_t_p_r_o_t_o_b_y_n_a_m_e, and _g_e_t_p_r_o_t_o_b_y_n_u_m_b_e_r each return a pointer
  38.      to an object with the following structure containing the broken-out
  39.      fields of a line in the network protocol data base file, /_e_t_c/_p_r_o_t_o_c_o_l_s,
  40.      or the NIS _p_r_o_t_o_c_o_l_s map.
  41.  
  42.           struct    protoent {
  43.                char *p_name;  /* official name of protocol */
  44.                char **p_aliases;   /* alias list */
  45.                int  p_proto;       /* protocol number */
  46.           };
  47.  
  48.      The members of this structure are:
  49.  
  50.      p_name     The official name of the protocol.
  51.  
  52.      p_aliases  A zero terminated list of alternate names for the protocol.
  53.  
  54.      p_proto    The protocol number.
  55.  
  56.      _G_e_t_p_r_o_t_o_e_n_t reads the  next  line  of  the  file,  opening  the  file  if
  57.      necessary.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GGGGEEEETTTTPPPPRRRROOOOTTTTOOOOEEEENNNNTTTT((((3333NNNN))))                                                GGGGEEEETTTTPPPPRRRROOOOTTTTOOOOEEEENNNNTTTT((((3333NNNN))))
  71.  
  72.  
  73.  
  74.      _S_e_t_p_r_o_t_o_e_n_t opens and rewinds the file.  If the  _s_t_a_y_o_p_e_n  flag  is  non-
  75.      zero,  the  net  data  base  will  not  be  closed  after  each  call  to
  76.      _g_e_t_p_r_o_t_o_b_y_n_a_m_e or _g_e_t_p_r_o_t_o_b_y_n_u_m_b_e_r.
  77.  
  78.      _E_n_d_p_r_o_t_o_e_n_t closes the file.
  79.  
  80.      _G_e_t_p_r_o_t_o_b_y_n_a_m_e  and  _g_e_t_p_r_o_t_o_b_y_n_u_m_b_e_r  sequentially   search   from   the
  81.      beginning  of  the file until a matching protocol name or protocol number
  82.      is found, or until EOF is encountered.
  83.  
  84.      The primitives documented in this manual entry first  consult  Sun's  NIS
  85.      distributed  lookup  service,  if  NIS  is  enabled,  and  then  the file
  86.      /_e_t_c/_p_r_o_t_o_c_o_l_s.
  87.  
  88.      _g_e_t_p_r_o_t_o_e_n_t__r,  _g_e_t_p_r_o_t_o_b_y_n_u_m_b_e_r__r  and  _g_e_t_p_r_o_t_o_b_y_n_a_m_e__r  are  reentrant
  89.      versions of the corresponding function calls.
  90.  
  91.      _f_g_e_t_p_r_o_t_o_e_n_t and _f_g_e_t_p_r_o_t_o_e_n_t__r will read entries off of the passed  file
  92.      handle.
  93.  
  94. NNNNOOOOTTTTEEEE
  95.      The Mips ABI specifies nothing but local files so applications which wish
  96.      to use anything else must compile with libc prior to libnsl in the
  97.      library list.  When nsd is running changes to the local protocols file
  98.      may not be noticed by getprotoent() until the enumeration cache file has
  99.      timed out.
  100.  
  101. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  102.      All functions that return struct protoent * will return a null (0)
  103.      pointer in the case of EOF or failure.
  104.  
  105. FFFFIIIILLLLEEEESSSS
  106.      /etc/protocols
  107.  
  108. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  109.      ypserv(1M), protocols(4)
  110.  
  111. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  112.      Null pointer (0) returned on EOF or error.
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.